home *** CD-ROM | disk | FTP | other *** search
/ Word Perfect Main Street: Paper Planes / WordPerfect Main Street - Paper Planes.iso / mac / Gloss / 00018_Script_18 < prev    next >
Text File  |  1994-05-12  |  2KB  |  53 lines

  1. -- this strange code is to allow the scroll bar to function normally,
  2. -- yet do my own hilite based on screen location....Lingo's hilite only works on
  3. -- editable text....which is not what we need
  4. on mouseDown
  5.   global GlossHilite, GlossText, MaxScreenLines
  6.   if the mouseH < (the locH of sprite GlossText + the width of sprite GlossHilite) then
  7.     set screenLine = the mouseV - the locV of sprite GlossText
  8.     set screenLine = (screenLine / the textHeight of field "Glossary")
  9.     if screenLine >= 0 and screenLine < MaxScreenLines then
  10.       set newLineV = (the textHeight of field "Glossary") * screenLine
  11.       set newLineV = newLineV + (the locV of sprite GlossText)
  12.       set the locV of sprite GlossHilite = newLineV
  13.     else
  14.       set the locV of sprite GlossHilite = 600  -- well off the bottom of the screen
  15.     end if
  16.   else
  17.     set the locV of sprite GlossHilite = 600  -- well off the bottom of the screen
  18.   end if
  19.   updateStage
  20. end
  21.  
  22. on mouseUp
  23.   global GlossHilite, GlossText, MaxScreenLines
  24.   global TheLine  -- used later in the "play" frames
  25.   set TheLine = the mouseLine  -- read as soon as we go up
  26.   if the mouseH < (the locH of sprite GlossText + the width of sprite GlossHilite) then
  27.     set screenLine = the mouseV - the locV of sprite GlossText
  28.     set screenLine = (screenLine / the textHeight of field "Glossary")
  29.     if screenLine >= 0 and screenLine < MaxScreenLines then
  30.       set newLineV = (the textHeight of field "Glossary") * screenLine
  31.       set newLineV = newLineV + (the locV of sprite GlossText)
  32.       set the locV of sprite GlossHilite = newLineV
  33.     else
  34.       set the locV of sprite GlossHilite = 600  -- well off the bottom of the screen
  35.     end if
  36.     updateStage
  37.     -- this field is the frame label for any visual
  38.     set theAudio = item 1 of line TheLine of field "GlossaryData"
  39.     set theLabel = item 2 of line TheLine of field "GlossaryData"
  40.     if theLabel <> EMPTY then
  41.       -- before visual
  42.       set the locV of sprite GlossHilite = 600  -- well off the bottom of the screen
  43.       play frame theLabel
  44.     else
  45.       if theAudio <> EMPTY then
  46.         play frame "AudioOnly"
  47.       end if
  48.       -- after audio
  49.       set the locV of sprite GlossHilite = 600  -- well off the bottom of the screen
  50.       updateStage
  51.     end if
  52.   end if
  53. end